home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / boost4.zip / HEAPER.PAS < prev    next >
Pascal/Delphi Source File  |  1988-10-23  |  1KB  |  44 lines

  1. Program Heaper;
  2. { Demonstrates moving a box nondestructively over a screen }
  3.  
  4. uses crt,BOSHARE;
  5.  
  6. var
  7.    i,x1,y1,Ecode : integer;
  8.    page : array[1..2] of HeapBuf;
  9.  
  10. begin
  11.  
  12.    { -- Set up 2 pages on heap -- }
  13.    Mark(HeapTop);
  14.    New(page[1]);
  15.    New(page[2]);
  16.  
  17.    ClrScr;
  18.    SaveScreen ( Page[1] );
  19.    BoxHeap ( Page[1], 1,1, 20, 10, 1, 14 );   { build a box }
  20.    HeapAtt ( Page[1], 1, 1, 20, 10, 112 );   { add fill }
  21.  
  22.    { -- Read in a ScrGen HELP screen -- }
  23.    Fil2Heap('Help16.Gen',1,1,Page[2],Ecode );
  24.    if Ecode <> 0 then begin
  25.       Write('Help16.Gen not found.');
  26.       exit;
  27.    end;
  28.    RestoreScreen ( Page[2] );
  29.  
  30.    { -- Flash a box over the HELP screen until a keypress -- }
  31.    repeat
  32.       x1 := 1 + random(59);
  33.       y1 := 1 + random(16);
  34.       { Show the box }
  35.       Heap2Scr ( Page[1],1,1,20,10,x1,y1);
  36.       delay(50);
  37.       { Restore the portion that the box erased }
  38.       Heap2Scr ( Page[2],x1,y1,x1+19,y1+9,x1,y1 );
  39.    until Keypressed;
  40.  
  41.    Release(HeapTop);
  42.  
  43. end.
  44.